<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
    />
    <title>登录原型</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }

      body {
        font-family:
          -apple-system,
          BlinkMacSystemFont,
          'Helvetica Neue',
          Helvetica,
          Segoe UI,
          Arial,
          Roboto,
          'PingFang SC',
          'miui',
          'Hiragino Sans GB',
          'Microsoft Yahei',
          sans-serif;
        background-color: #f7f8fa;
        color: #323233;
        line-height: 1.5;
      }

      .login-container {
        padding: 20px;
        max-width: 100%;
        margin: 0 auto;
      }

      .login-type-tabs {
        display: flex;
        margin-bottom: 30px;
        border-bottom: 1px solid #eee;
      }

      .login-type-tabs button {
        flex: 1;
        padding: 12px;
        background: none;
        border: none;
        font-size: 16px;
        color: #666;
        position: relative;
      }

      .login-type-tabs button.active {
        color: #1989fa;
        font-weight: bold;
      }

      .login-type-tabs button.active::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 20%;
        right: 20%;
        height: 3px;
        background: #1989fa;
        border-radius: 3px;
      }

      .login-form h2 {
        text-align: center;
        margin-bottom: 30px;
        color: #333;
      }

      .login-methods {
        display: flex;
        margin-bottom: 20px;
      }

      .login-methods button {
        flex: 1;
        padding: 10px;
        background: none;
        border: none;
        font-size: 14px;
        color: #666;
      }

      .login-methods button.active {
        color: #1989fa;
        font-weight: bold;
      }

      .form-group {
        margin-bottom: 20px;
      }

      .form-group label {
        display: block;
        margin-bottom: 8px;
        font-size: 14px;
        color: #666;
      }

      .form-group input {
        width: 100%;
        padding: 12px 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 15px;
      }

      .form-group input:focus {
        border-color: #1989fa;
        outline: none;
      }

      .phone-input {
        display: flex;
        gap: 10px;
      }

      .phone-input input {
        flex: 1;
      }

      .sms-btn {
        width: 120px;
        background: #f5f5f5;
        border: 1px solid #ddd;
        border-radius: 4px;
        color: #1989fa;
      }

      .sms-btn:disabled {
        color: #999;
      }

      .form-options {
        display: flex;
        justify-content: space-between;
        margin-bottom: 20px;
        font-size: 14px;
      }

      .forgot-password {
        color: #1989fa;
        text-decoration: none;
      }

      .login-btn {
        width: 100%;
        padding: 12px;
        background: #1989fa;
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        margin-bottom: 20px;
      }

      .wechat-login {
        text-align: center;
      }

      .wechat-login p {
        color: #999;
        margin-bottom: 15px;
        position: relative;
      }

      .wechat-login p::before,
      .wechat-login p::after {
        content: '';
        position: absolute;
        top: 50%;
        width: 30%;
        height: 1px;
        background: #eee;
      }

      .wechat-login p::before {
        left: 0;
      }

      .wechat-login p::after {
        right: 0;
      }

      .wechat-btn {
        background: none;
        border: none;
        width: 40px;
        height: 40px;
        background-color: #07c160;
        border-radius: 50%;
        color: white;
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
      }
    </style>
  </head>
  <body>
    <div class="login-container">
      <!-- 登录类型切换 -->
      <div class="login-type-tabs">
        <button class="active" onclick="switchLoginType('system')">系统用户</button>
        <button onclick="switchLoginType('client')">客户</button>
      </div>

      <!-- 系统用户登录表单 -->
      <div id="systemLogin" class="login-form">
        <h2>系统用户登录</h2>
        <div class="form-group">
          <label>账号</label>
          <input type="text" placeholder="请输入账号" />
        </div>
        <div class="form-group">
          <label>密码</label>
          <input type="password" placeholder="请输入密码" />
        </div>
        <div class="form-options">
          <label>
            <input type="checkbox" />
            记住密码
          </label>
          <a href="#" class="forgot-password">忘记密码？</a>
        </div>
        <button class="login-btn">登录</button>
        <div class="wechat-login">
          <p>或使用微信登录</p>
          <button class="wechat-btn">W</button>
        </div>
      </div>

      <!-- 客户登录表单 -->
      <div id="clientLogin" class="login-form" style="display: none">
        <h2>客户登录</h2>
        <div class="login-methods">
          <button class="active" onclick="switchClientMethod('phone')">手机验证码</button>
          <button onclick="switchClientMethod('account')">账号密码</button>
        </div>

        <div id="phoneLogin">
          <div class="form-group">
            <label>手机号</label>
            <div class="phone-input">
              <input type="tel" placeholder="请输入手机号" />
              <button class="sms-btn">获取验证码</button>
            </div>
          </div>
          <div class="form-group">
            <label>验证码</label>
            <input type="text" placeholder="请输入验证码" />
          </div>
        </div>

        <div id="accountLogin" style="display: none">
          <div class="form-group">
            <label>账号</label>
            <input type="text" placeholder="请输入账号" />
          </div>
          <div class="form-group">
            <label>密码</label>
            <input type="password" placeholder="请输入密码" />
          </div>
        </div>

        <div class="form-options">
          <div></div>
          <a href="#" class="forgot-password">忘记密码？</a>
        </div>
        <button class="login-btn" id="clientLoginBtn">验证码登录</button>
        <div class="wechat-login">
          <p>或使用微信登录</p>
          <button class="wechat-btn">W</button>
        </div>
      </div>
    </div>

    <script>
      function switchLoginType(type) {
        const systemLogin = document.getElementById('systemLogin')
        const clientLogin = document.getElementById('clientLogin')
        const tabs = document.querySelectorAll('.login-type-tabs button')

        if (type === 'system') {
          systemLogin.style.display = 'block'
          clientLogin.style.display = 'none'
          tabs[0].classList.add('active')
          tabs[1].classList.remove('active')
        } else {
          systemLogin.style.display = 'none'
          clientLogin.style.display = 'block'
          tabs[0].classList.remove('active')
          tabs[1].classList.add('active')
        }
      }

      function switchClientMethod(method) {
        const phoneLogin = document.getElementById('phoneLogin')
        const accountLogin = document.getElementById('accountLogin')
        const loginBtn = document.getElementById('clientLoginBtn')
        const methods = document.querySelectorAll('.login-methods button')

        if (method === 'phone') {
          phoneLogin.style.display = 'block'
          accountLogin.style.display = 'none'
          loginBtn.textContent = '验证码登录'
          methods[0].classList.add('active')
          methods[1].classList.remove('active')
        } else {
          phoneLogin.style.display = 'none'
          accountLogin.style.display = 'block'
          loginBtn.textContent = '账号登录'
          methods[0].classList.remove('active')
          methods[1].classList.add('active')
        }
      }
    </script>
  </body>
</html>
